<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>航空主单支出</title>
        <% include("/common/common_css_js.html"){} %>
    </head>
    <body>
        <div style="padding-bottom: 5px;">
            <div id="queryForm" class="uc-toolbaroverflow" _borderStyle="border-top:0;">
                <span>主单号：</span><input id="keyMasterBillCode" name="keyMasterBillCode" emptyText="请输入主单号"  class="mini-textbox" selectOnFocus="true" required="false" requiredErrorText="主单号不能为空" />
                <span class="separator"></span>
                <span>配货方式:</span><input id="keyloadWayId" name="keyloadWayId" class="mini-combobox" style="width:150px;" textField="name" valueField="id" emptyText="请选择..."
                                         required="false" allowInput="false" showNullItem="true" nullItemText="请选择..." requiredErrorText="没有选择配货方式" />
                <span class="separator"></span>
                <span>承运方式:</span><input id="keyTransportWayId" name="keyTransportWayId" class="mini-combobox" style="width:150px;" textField="name" valueField="id" emptyText="请选择..."
                                         required="false" allowInput="false" showNullItem="true" nullItemText="请选择..." requiredErrorText="没有选择承运方式"/>

                <span class="separator"></span>
                <span>收货人:</span>
                <input id="keyReceiveCustomerName" name="keyReceiveCustomerName" style="width:250px;"  emptyText="收货人名称"  class="mini-textbox" selectOnFocus="true" required="false" requiredErrorText="收货人名称不能为空"/>

                <div style="margin-top: 5px"></div>
                <span>开单日期：</span>
                <input id="keyOpenMasterBillStartDate" name="keyOpenBillStartDate"  class="mini-datepicker"   format="yyyy-MM-dd"/>--<input id="keyOpenMasterBillEndDate" name="keyOpenBillEndDate" class="mini-datepicker"  format="yyyy-MM-dd"/>

                <span class="separator"></span>
                <span>地面运费结算状态:</span>
                <input id="keyGroundAmountStatusId" name="keyGroundAmountStatusId" class="mini-combobox" style="width:120px;" textField="name" valueField="id" emptyText="请选择..."
                       required="false" allowInput="false" showNullItem="true" nullItemText="请选择..." requiredErrorText="没有选择地面运费结算状态"/>
                <span class="separator"></span>
                <span>航空运费结算状态:</span>
                <input id="keyTransportCostStatusId" name="keyTransportCostStatusId" class="mini-combobox" style="width:120px;" textField="name" valueField="id" emptyText="请选择..."
                       required="false" allowInput="false" showNullItem="true" nullItemText="请选择..." requiredErrorText="没有选择航空运费结算状态"/>
                <span class="separator"></span>
                <span>航空附加费结算状态:</span>
                <input id="keyAirlinesAddCostStatusId" name="keyAirlinesAddCostStatusId" class="mini-combobox" style="width:120px;" textField="name" valueField="id" emptyText="请选择..."
                       required="false" allowInput="false" showNullItem="true" nullItemText="请选择..." requiredErrorText="没有选择航空附加费结算状态"/>

                <span>其他费用结算状态:</span>
                <input id="keyOtherChargesStatusId" name="keyOtherChargesStatusId" class="mini-combobox" style="width:120px;" textField="name" valueField="id" emptyText="请选择..."
                       required="false" allowInput="false" showNullItem="true" nullItemText="请选择..." requiredErrorText="没有选择其他费用结算状态"/>


                <div style="margin-top: 5px"></div>

                <% if(so.hasPermission("airMasterBillPay:query")){%>
                    <a class="mini-button" iconCls="icon-search" onclick="searchBill()">查询</a>
                <% } %>

                <% if(so.hasPermission("airMasterBillPay:queryCndClear")){%>
                    <a class="mini-button" iconCls="icon-new" onclick="clearSearch()">清空查询条件</a>
                <% } %>



                <% if(so.hasPermission("airMasterBillPay:download")){%>
                <span class="separator"></span>
                <#download_grid id="downloadGrid" theGridId="datagrid1" theFileName="航空主单结费表"/>
                <% } %>

                <div style="margin-top: 5px"></div>


                <% if(so.hasPermission("airMasterBillPay:clearGroundCharge")){%>
                    <a class="mini-button" iconCls="icon-new" onclick="clearCharge(390)">地面运费结算</a>
                    <a class="mini-button" iconCls="icon-ok" onclick="showSettlementPanel(1)">导入地面运费结算</a>

                <% } %>

                <% if(so.hasPermission("airMasterBillPay:clearAirFreightCharge")){%>
                <span class="separator"></span>
                    <a class="mini-button" iconCls="icon-new" onclick="clearCharge(391)">航空运费结算</a>
                    <a class="mini-button" iconCls="icon-ok" onclick="showSettlementPanel(0)">导入航空运费结算</a>
                <% } %>

                <% if(so.hasPermission("airMasterBillPay:clearAirlinesAddCost")){%>
                <span class="separator"></span>
                    <a class="mini-button" iconCls="icon-new" onclick="clearCharge(392)">航空附加费结算</a>
                    <a class="mini-button" iconCls="icon-ok" onclick="showSettlementPanel(2)">导入航空附加费结算</a>

                <% } %>

                <% if(so.hasPermission("airMasterBillPay:clearOtherCharge")){%>
                <span class="separator"></span>
                    <a class="mini-button" iconCls="icon-new" onclick="clearCharge(393)">航空其他费用结算</a>
                    <a class="mini-button" iconCls="icon-ok" onclick="showSettlementPanel(3)">导入航空其他费用结算</a>
                <% } %>

                <a href="${base!}/hymj/files/航空主单对账模板.rar" target="_blank">点击下载《航空主单结算》模板</a>




                <div style="margin-top: 5px"></div>
                <span style="color: red;font-weight: bold">
                    <span>注:1.【初始配载分单号】表示主单初始配载时所包含的分单号 </span>
                    <span style="margin-left: 10px">2.主单如果做过全拉货操作，则主单下配载分单会被清空，而列表中显示的【初始配载分单号】不会清除(用于标识地面运费成本标识) </span>
                </span>

            </div>
        </div>

        <div class = "mini-fit">
            <div id="datagrid1" class="mini-datagrid"
                 style="width: 100%; height: 100%;"
                 url="${base}/pages/finance_manage/pay/queryFlightMasterBillList" idField="id"
                 showPager="true" pageSize="20" sizeList="[10,20,30,50,100]"
                 multiSelect = "true" allowResize="true"
                 showGroupsSummary="true" showSummaryRow="true" summaryPosition="bottom"
                 allowSortColumn = "true"
                 sortField="createTime"
                 sortOrder="desc"
                 ondrawsummarycell="summaryRight"
            >
                <div property="columns">
                    <div type="checkcolumn" ></div>
                    <div field="id" width="140" headerAlign="center" align="center" allowSort="true" renderer="showMasterBillRender">航空主单号</div>
                    <div field="loadNativeBillIds" width="140" headerAlign="center" align="center">初始配载分单号</div>
                    <div field="groundAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">地面运费</div>
                    <div field="pullDisposeGroundAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">地面运费调整金额</div>
                    <div field="groundAmountStatusId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">地面运费结算状态</div>
                    <div field="transportCost" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">航空运费</div>
                    <div field="pullDisposeTransportCostAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">航空运费调整金额</div>
                    <div field="transportCostStatusId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">航空运费结算状态</div>

                    <div field="airlinesAddCost" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">航空附加费</div>
                    <div field="pullDisposeAirlinesAddCostAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">航空附加费调整金额</div>
                    <div field="airlinesAddCostStatusId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">航空附加费结算状态</div>

                    <div field="otherCharges" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">其他费用</div>
                    <div field="pullDisposeOtherChargesAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">其他费用调整金额</div>
                    <div field="otherChargesStatusId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">其他费用结算状态</div>


                    <div field="settlementStatusId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">主单结算状态</div>

                    <div field="loadWayId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"sysDic"}' renderer="commonRender">配货方式</div>
                    <div field="transportWayId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"sysDic"}' renderer="commonRender">承运方式</div>
                    <div field="outUnitId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"outUnit"}' renderer="commonRender">外发单位</div>
                    <div field="destCityId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"city"}' renderer="commonRender">目的市</div>

                    <div field="goodsTypeId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"sysDic"}' renderer="commonRender">货物类型</div>
                    <div field="airportId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"airport"}' renderer="commonRender">始发机场</div>
                    <div field="airlinesId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"airlines"}' renderer="commonRender">航空公司</div>
                    <div field="flightDate" width="140" headerAlign="center" align="center" allowSort="false" dateFormat="yyyy-MM-dd" renderer="ondayRenderer">航班日期</div>
                    <!--                    <div field="flightNo" width="140" headerAlign="center" align="center" allowSort="true">航班ID</div>-->
                    <div field="flightName" width="140" headerAlign="center" align="center" allowSort="true">航班名</div>

                    <div field="agentCompanyName" width="140" headerAlign="center" align="center" allowSort="true">代理公司名</div>
                    <div field="agentCompanyPhone" width="140" headerAlign="center" align="center" allowSort="true">代理公司电话</div>
                    <div field="agentCompanyAddress" width="140" headerAlign="center" align="center" allowSort="true">代理公司地址</div>

                    <div field="receiveCustomerName" width="140" headerAlign="center" align="center" allowSort="true">收货人名称</div>
                    <div field="receiveCustomerPhone" width="140" headerAlign="center" align="center" allowSort="true">收货人电话</div>
                    <div field="receiveCustomerAddress" width="140" headerAlign="center" align="center" allowSort="true">收货人地址</div>

                    <div field="freightSpeciesId" width="140" headerAlign="center" align="center" allowSort="true"  data-options='{cacheName:"sysDic"}' renderer="commonRender">运价种类</div>
                    <div field="goodsCodeId" width="140" headerAlign="center" align="center" allowSort="true"  data-options='{cacheName:"sysDic"}' renderer="commonRender">商品代号</div>
                    <div field="goodsName" width="140" headerAlign="center" align="center" allowSort="true" >货物名称</div>
                    <div field="packingWayId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"sysDic"}' renderer="commonRender">包装方式</div>
                    <div field="airportGoodsSiteId" width="140" headerAlign="center" align="center" allowSort="true" data-options='{cacheName:"airportGoodsSite"}' renderer="commonRender">航空货站</div>

                    <div field="totalNumber" width="140" headerAlign="center" align="right" allowSort="false" summaryType="sum">总件数</div>
                    <div field="actualWeight" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">实际重量</div>
                    <div field="chargeableWeight" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">计费重量</div>
                    <div field="weightRate" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" >重量费率</div>
                    <div field="declaredValue" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">声明价值</div>
                    <div field="stampDuty" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">印花税</div>
                    <div field="insuranceFee" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">保险费</div>

                    <div field="otherCharges" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">其他费用</div>
                    <div field="pullDisposeOtherChargesAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">其他费用调整金额</div>
                    <div field="otherChargesComment" width="140" headerAlign="center" align="center" allowSort="true">其他费用说明</div>

                    <div field="masterBillPaymentMethodId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">付款方式</div>
                    <div field="totalAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">总金额</div>
                    <div field="dropAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">调整金额</div>
                    <div field="settlementAmount" width="140" headerAlign="center" align="right" allowSort="false" renderer="public_moneyRenderer" summaryType="sum">结算金额</div>

                    <div field="openMasterBillDate" width="140" headerAlign="center" align="center" allowSort="false" dateFormat="yyyy-MM-dd HH:mm:ss" renderer="ondayRenderer">开单日期</div>
                    <div field="openMasterBillDepartmentId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"department"}' renderer="commonRender">开单部门</div>
                    <div field="openMasterBillUserId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysUser"}' renderer="commonRender">开单人</div>
                    <div field="comment" width="140" headerAlign="center" align="center" allowSort="false">备注</div>

                    <div field="dropStatusId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysDic"}' renderer="commonRender">拉货状态</div>


<!--                    <div field="createTime" width="140" headerAlign="center" align="center" allowSort="false" dateFormat="yyyy-MM-dd HH:mm:ss" renderer="ondayRenderer">创建时间</div>-->
<!--                    <div field="createUserId" width="140" headerAlign="center" align="center" allowSort="false" data-options='{cacheName:"sysUser"}' renderer="commonRender">创建用户</div>-->

                </div>
            </div>
        </div>


        <!-- 结算数据上传 -->
        <div id="settlementPanel" class="mini-window" title="结算数据上传" style="width:800px;height:600px;"
             showMaxButton="true" showCollapseButton="false" showMinButton="true" showShadow="true"
             showToolbar="true" showFooter="true" showModal="true" allowResize="true" allowDrag="true" >
            <div property="footer" style="padding:10px;text-align: right">
                <a  id="uploadBtn" name="uploadBtn" class="mini-button" iconCls="icon-upload" onclick="uploadSettlement()">上传并结算</a>
                <a  class="mini-button" iconCls="icon-close" onclick="public_onCancel('settlementPanel')">关闭</a>
            </div>


            <span id="fileTitle">文件:</span>
            <form id="upload-form-add" style="display: inline">
                <input type="file" id="upLoadSettlementFileData" name="upLoadFileData"  accept=".xls,.xlsx" />
            </form>


            <div style="height: 5px"></div>
            <span>结算结果:</span>
            <div style="height: 5px"></div>
            <div id="settlementResult" style="color: red">

            </div>

        </div>

        <script type="text/javascript">
            mini.parse();

            let keyMasterBillCode = mini.get("keyMasterBillCode");
            let keyloadWayId = mini.get("keyloadWayId");
            let keyTransportWayId = mini.get("keyTransportWayId");
            let keyReceiveCustomerName = mini.get("keyReceiveCustomerName");
            let keyOpenMasterBillStartDate = mini.get("keyOpenMasterBillStartDate");
            let keyOpenMasterBillEndDate = mini.get("keyOpenMasterBillEndDate");
            let keyGroundAmountStatusId = mini.get("keyGroundAmountStatusId");
            let keyTransportCostStatusId = mini.get("keyTransportCostStatusId");
            let keyAirlinesAddCostStatusId = mini.get("keyAirlinesAddCostStatusId");
            let keyOtherChargesStatusId = mini.get("keyOtherChargesStatusId");

            // 主 grid
            let grid = mini.get("datagrid1");

            // 定义结清状态
            let settlementStatus = {uncleared:321, cleared:322};

            // 定义费用类型
            let chargeType = {nativeBillAgentDeliveryCharge:381, nativeBillServiceCharge:382,
                ariMasterBillGroundCharge:390, airMasterBillTotalAmount:391, airMasterBillAirlinesAddCost:392,
                airMasterBillOtherCharges:393,
                autoMasterBillTotalAmount:400};

            // 代表的是分单
            let billType = {nativeBill:371, airMasterBill:372, autoMasterBill:373};


            let fileTitle = document.getElementById("fileTitle");

            let settlementResult = document.getElementById("settlementResult");

            $(function () {

                // 配货方式
                let keyLoadWayIdJsonData=commonRenderSysDicDropListByKey("sysDic","XT_DIC_LOAD_WAY");
                keyloadWayId.load(keyLoadWayIdJsonData);

                // 承运方式下拉列表
                let keyTransportWayIdJsonData=commonRenderSysDicDropListByKey("sysDic","XT_DIC_TRANSPORT_WAY");
                keyTransportWayId.load(keyTransportWayIdJsonData);

                // 地面运费结费状态
                let keyGroundAmountStatusIdJsonData=commonRenderSysDicDropListByKey("sysDic","XT_DIC_SETTLEMENT_STATUS");
                keyGroundAmountStatusId.load(keyGroundAmountStatusIdJsonData);

                // 航空运费结费状态
                let keyTransportCostStatusIdJsonData=public_deepClone(keyGroundAmountStatusIdJsonData);
                keyTransportCostStatusId.load(keyTransportCostStatusIdJsonData);

                // 航空附加费结费状态
                keyAirlinesAddCostStatusId.load(public_deepClone(keyGroundAmountStatusIdJsonData));
                // 其他费用结算状态
                keyOtherChargesStatusId.load(public_deepClone(keyGroundAmountStatusIdJsonData));


                // 加载列表数据
                grid.load();
            });

            /**
             * 清空查询条件
             */
            function clearSearch(){
                let form = new mini.Form("#queryForm");
                form.clear();
            }

            /**
             * 根据查询条件查询分单
             */
            function searchBill(){
                let form = new mini.Form("#queryForm");
                let data = form.getData(true);
                grid.load(data);
            }

            // 展示主单号时显示其超链接
            function showMasterBillRender(e){
                // renderer="showMasterBillRender"

                let masterBillId = e.value;
                let htmlStr = "<a href='javascript:void(0);' onclick='showViewMasterBill(\""+ masterBillId +"\")'>" + masterBillId + "</a>";

                return htmlStr;
            }

            function showViewMasterBill(masterBillId){
                let tabUrl= "${base}/pages/master_bill_manage/flight/showUpdateMasterBill?opType=view&id=" + masterBillId;
                let tabTitle = "航空主单查看";
                parent.window.addTabToMainPage(tabTitle,tabTitle,tabUrl);
            }


            /**
             * 设置统计样式
             */
            function summaryRight(e){
                e.cellStyle="text-align:right;color:red;font-size:18px;font-weight:bold";
            }

            /**
             * 结清费用
             */
            function clearCharge(typeId){
                let selectItems = grid.getSelecteds();
                if(selectItems.length == 0){
                    showAlert("没有选择需要结清费用的航空主单行!",null);
                    return;
                }
                // 开始遍历
                let clearedBillIds = "";
                let idArray=[];
                for(let billObj of selectItems){
                    let statusId;
                    if(typeId == chargeType.ariMasterBillGroundCharge){
                        statusId = billObj.groundAmountStatusId;
                    }
                    else if(typeId = chargeType.airMasterBillTotalAmount){
                        statusId = billObj.transportCostStatusId;
                    }
                    else{
                        statusId = billObj.airlinesAddCostStatusId;
                    }

                    if(statusId == settlementStatus.cleared){
                        clearedBillIds += billObj.id + " ";
                    }
                    else{
                        let obj;
                        if(typeId == chargeType.ariMasterBillGroundCharge){
                            obj={billId:billObj.id,billAmount:billObj.groundAmount};
                        }
                        else if (typeId == chargeType.airMasterBillTotalAmount){
                            obj={billId:billObj.id,billAmount:billObj.transportCost};
                        }
                        else{
                            obj={billId:billObj.id,billAmount:billObj.airlinesAddCost};
                        }
                        idArray.push(obj);
                    }
                }

                if(clearedBillIds.length > 0){
                    if(typeId == chargeType.ariMasterBillGroundCharge){
                        showAlert("主单号【" + clearedBillIds + "】，地面运费结清状态为【已结清】，请不要选择!");
                    }
                    else if(typeId == chargeType.airMasterBillTotalAmount){
                        showAlert("主单号【" + clearedBillIds + "】，航空运费结清状态为【已结清】，请不要选择!");
                    }
                    else if(typeId == chargeType.airMasterBillAirlinesAddCost){
                        showAlert("主单号【" + clearedBillIds + "】，航空附加费用结清状态为【已结清】，请不要选择!");
                    }
                    else{
                        showAlert("主单号【" + clearedBillIds + "】，航空其他费用结清状态为【已结清】，请不要选择!");
                    }
                    return;
                }

                // 到此校验全部成功，可以入库了
                let clearNatvieBillServiceChargeUrl = "${base}/pages/finance_manage/pay/clearedBillCharge";
                let billTypeIdValue = billType.airMasterBill;
                let ret = public_getServerData(clearNatvieBillServiceChargeUrl, {idList:idArray,billTypeId:billTypeIdValue,clearChargeTypeId:typeId,statusId:settlementStatus.cleared});
                showAlert(ret.message,function (){
                    grid.reload();
                });

            }

            // 结算文件类型
            let settlementFileType;
            let fileTitleValue;
            function showSettlementPanel(settlementType){
                if(settlementType == 0){
                    fileTitleValue = "航空运费结算文件";

                }
                else if(settlementType == 1){
                    fileTitleValue = "地面操作费结算文件";
                }
                else if(settlementType == 2){
                    fileTitleValue = "航空附加费结算文件";
                }
                else if(settlementType == 3){
                    fileTitleValue = "其他费用结算文件";
                }

                fileTitle.innerText = fileTitleValue + ":";
                settlementFileType = settlementType;

                let form_add = new mini.Form("#upload-form-add");
                form_add.clear();

                settlementResult.innerHTML = "";

                // 弹出添加窗口
                public_showModelAtPos("settlementPanel", "center", "middle");
            }


            function uploadSettlement(){
                // 上传并结算
                let fileInput = $('#upLoadSettlementFileData').get(0).files[0];
                if(fileInput){
                    mini.confirm("您确认上传" + fileTitleValue + "数据?", "提示", function(confirmAction){
                        if(confirmAction == "ok"){
                            let messageid = mini.loading("正在上传校验及上传处理中，请稍后...","结算文件Excel上传");
                            flightAjaxFileUpload(messageid);
                        }
                    });
                }else{
                    mini.alert("没有选择要上传的对账信息数据Excel文件!");
                }
            }

            // 调用异步上传
            function flightAjaxFileUpload(messageid) {
                let formData = new FormData($("#upload-form-add")[0]);
                $.ajax({
                    //接口地址
                    url: '${base}/pages/master_bill_manage/flight/settlementFileUploadAndCheck?settlementFileType='+ settlementFileType ,
                    type: 'POST',
                    data: formData,
                    async: false,
                    cache: false,
                    contentType: false,
                    processData: false,
                    success: function (data) {

                        mini.hideMessageBox(messageid);

                        settlementResult.innerHTML = data.message;

                        // 清空上传对象
                        clearUploadFile("upload-form-add");

                        // 重新刷新数据
                        grid.reload();

                    },
                    error: function (returndata) {
                        mini.alert("网络异常，请重试！");
                    }
                });
            }


        </script>



    </body>
</html>